Primary Visualization
Earthquake Magnitude Distribution
ggplot(earthquake_df, aes(x = mag)) +
geom_histogram(fill = "lightblue", color = "darkblue") +
geom_freqpoly(color = "darkgreen") +
labs(title = "Earthquake Magnitude Distribution",
x = "Magnitude",
y = "Frequency")
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Intepretation
The histogram above shows the distribution of earthquake magnitudes. The majority of earthquakes have a magnitude between 4 and 5. There are very few earthquakes with a magnitude greater than 7. This is consistent with the fact that most earthquakes are small and go unnoticed by people, while large earthquakes are relatively rare.
Earthquake Magnitude vs Depth
$type <- as.factor(earthquake_df$type)
earthquake_df
|>
earthquake_df filter(type == "earthquake") |>
ggplot(aes(y = mag, x = depth)) +
geom_jitter(alpha = 0.1, color = "#a45b9c") +
geom_smooth(method = "lm",
se = FALSE,
color = "red") +
labs(title = "Earthquake Magnitude vs Depth",
x = "Depth",
y = "Magnitude") +
scale_fill_viridis_c()
`geom_smooth()` using formula = 'y ~ x'
Intepretation
The scatter plot above shows the relationship between earthquake magnitude and depth. There is a weak positive relationship between earthquake magnitude and depth. This means that larger earthquakes tend to occur at greater depths. However, the relationship is not very strong, and there is a lot of variability in the data. This suggests that depth is not a very good predictor of earthquake magnitude.
Earthquake Magnitude vs rms (Root Mean Square)
|>
earthquake_df filter(type == "earthquake") |>
ggplot(aes(y = mag, x = rms)) +
geom_jitter(alpha = 0.5, color = "#a45b9c") +
geom_smooth(method = "lm",
se = FALSE,
color = "red") +
labs(title = "Earthquake Magnitude vs rms",
x = "rms",
y = "Magnitude")
`geom_smooth()` using formula = 'y ~ x'
Intepretation
The scatter plot above shows the relationship between earthquake magnitude and rms (Root Mean Square). There seems to be a positive relationship between earthquake magnitude and rms. This means that larger earthquakes tend to have higher rms values. However, the relationship is not very strong, and there is a lot of variability in the data. This suggests that rms is not a very good predictor of earthquake magnitude.
Geographical Distribution of Earthquakes
library(maps)
Warning: package 'maps' was built under R version 4.2.3
Attaching package: 'maps'
The following object is masked from 'package:purrr':
map
<- map_data("world")
world_map
ggplot() +
geom_polygon(data = world_map, aes(x = long, y = lat, group = group),
fill = "grey", color = "black") +
coord_map(projection = "mercator", xlim = c(-180, 180)) +
geom_point(data = earthquake_df,
aes(x = longitude, y = latitude, color = mag), alpha = 0.6) +
labs(title = "Global Earthquakes 2023") +
scale_color_viridis_c(name = "Magnitude") +
theme(plot.title = element_text(size = rel(2)),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.ticks.y = element_blank())
Interpretation
The map above shows the geographical distribution of earthquakes around the world. The color of the points represent the magnitude of the earthquakes with varying intensities. There are many earthquakes in the Pacific Ocean, along the west coast of South America, and in the Himalayas. There are also many earthquakes in the Mediterranean region, the Middle East, and Indonesia. There are relatively few earthquakes in Africa, Australia, and the central part of South America.The earthquakes points seem to be concentrated along the tectonic plate boundaries. This is consistent with the fact that most earthquakes occur along tectonic plate boundaries, where the Earth’s crust is under the most stress.
Conclusion
In conclusion, this analysis has provided insights into the distribution of earthquake magnitudes, the relationship between earthquake magnitudes and depths, and the geographical distribution of earthquakes around the world. The majority of earthquakes have a magnitude between 4 and 5, and there are very few earthquakes with a magnitude greater than 7. There is a weak positive relationship between earthquake magnitude and depth, and a weak positive relationship between earthquake magnitude and rms. The geographical distribution of earthquakes is consistent with the fact that most earthquakes occur along tectonic plate boundaries. I would like to further investigate the way the magnitude of earthquakes has changed over time. I would argue that my visualizations are effective in communicating the relationships between magnitude, depth, and geographical distribution of earthquakes. The visualizations are clear, easy to understand, and provide valuable insights into the data due to the use of color, size, and position to represent different attributes of the data. The scatter plot effectively shows the relationship between earthquake magnitude and depth, and the map effectively shows the geographical distribution of earthquakes around the world.All the plots have a low data-ink ratio and are not misleading.